package com.cjl.multi_thread.share_cooperate;

import com.cjl.multi_thread.base_control.Sleeper;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class TestLock {

    Lock lock = new ReentrantLock();

    private void test(){
        lock.lock();
        try {
            Sleeper.sleep(500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        } finally {
            lock.unlock();
        }
    }
}
